﻿using NHibernate;
using NHibernate.Cfg;

namespace Zdm.Crm.Client.Winform.Dao
{
    public sealed class NHibernateHelper
    {
        private static readonly ISessionFactory SessionFactory;

        static NHibernateHelper()
        {
            SessionFactory = new Configuration().Configure().BuildSessionFactory();
        }

        public static ISession GetSession()
        {
            return SessionFactory.OpenSession();
        }
    }
}
